/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Tools;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import oracle.jdbc.OracleDriver;

/**
 *
 * @author Fave
 */
public class KoneksiDatabase {
 private static String jdbcURL = "jdbc:Oracle:thin:@172.23.9.185:1521:orcl";
    private static String user = "MHS105314093";
    private static String password = "MHS105314093";

//    private static String jdbcURL = "jdbc:Oracle:thin:@localhost:1521:XE";
//    private static String user = "hr";
//    private static String password = "hr";

    private static Connection connection;

    public static Connection KoneksiDataBase() throws SQLException {

        if (connection == null) {
            DriverManager.registerDriver(new OracleDriver());

            connection = DriverManager.getConnection(jdbcURL, user, password);
            System.out.println("koneksi berhasil");
        }
        return connection;
    }
}


